package DBO;
import java.util.List;
 
import org.restlet.resource.ClientResource;
 
import android.util.Log;
 
public class UserControl {
 public final ClientResource cr = new ClientResource(
 EngineConfiguration.gae_path + "/rest/user");
 
 public UserControl() {
	 EngineConfiguration.getInstance();
 }
 
 public void create(Contact user) throws Exception {
 final UserControlInterface uci = cr.wrap(UserControlInterface.class);
 
	 try {
		 uci.create(user);
		 Log.i("UserController", "Creation success !");
		 } catch (Exception e) {
		 Log.i("UserController", "Creation failed !");
		 throw e;
		 }
	 }
	 
 public List<Contact> getAllUsers() {
	 final UserControlInterface uci = cr
	 .wrap(UserControlInterface.class);
	 Container content = uci.getAllContacts();
	 return content.getUser_list();
	 }
}